<h1>Editing image</h1>

<%= error_messages_for :image %>

<% form_for(:image, :url => image_path(@image), :html => { :method => :put, :multipart => true }) do |f| %>
  <p>
    <b>Title</b><br />
    <%= f.text_field :title %>
  </p>

  <p>
    <b>Description</b><br />
    <%= f.text_area :description %>
  </p>

  <p>
    <b>Created at</b><br />
    <%= f.datetime_select :created_at %>
  </p>

  <p>
    <b>Update file</b><br />
    <%= f.file_field :image_file %>
  </p>

  <p>
    <img src=<%=  "/images/#{@image.id};showfile"%> alt=<%= "#{@image.title}" %> />
  </p>

  <%= link_to 'Painter', {:action => 'painter', :id => @image.id}, {:class => 'lbOn'} %>

  <p>
    <%= submit_tag "Update" %>
  </p>
<% end %>

<%= link_to 'Show', image_path(@image) %> |
<%= link_to 'Back', images_path %>
